package Q.test04162.Mapper;
import org.apache.ibatis.annotations.*;
import java.util.List;

@Mapper
public interface UserInfoMapper {
    @Results(id = "selectMapper",value={
            @Result(column = "delete_flag",property = "deleteFlag"),
            @Result(column = "create_time",property = "createTime"),
            @Result(column = "update_time",property = "updateTime")

    })
    @Select("select * from user_info")
    @Options(useGeneratedKeys = true,keyProperty = "id")
    public List<UserInfo> select();


    @ResultMap(value="selectMapper")
    @Insert("insert into user_info (username,`password`,age) values (#{username},#{password},#{age})")
    public Integer insert(UserInfo user);

    @ResultMap(value = "selectMapper")
    @Select("select username, `password`, age, gender, phone from user_info where username= '${name}' and password= '${password}' ")
            List<UserInfo> queryByName(String name,String password);
}


